<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>显示最大值</title>
</head>

<body>
    <script>
        //第一题
        var x = Math.random();
        var y = Math.random();
        console.log('x:' + x, 'y:' + y);
        x > y ? console.log(x) : console.log(y);;

        //第二题
        var today = new Date(); //获取当天日期
        var year = today.getFullYear(); //获取当天年份
        console.log(year);
        if (year % 400 == 0) {
            console.log(year + ':是闰年');
        } else if (year % 4 == 0 && year % 100 != 0) {
            console.log(year + ':是闰年');
        } else {
            console.log(year + ':不是润年');
        }
       
      
        document.write("John said , \"Hi\" ! ");
    </script>
</body>

</html>